# coding=utf-8
from framework.base_page import BasePage

class AddCustomerPage(BasePage):
    input_nameofcustomer = "xpath=>//*[@id='name']"
    input_email = "xpath=>//*[@id='emails']"
    input_contactperson = "xpath=>//*[@id='contact']"
    input_tel = "xpath=>//*[@id='tel']"

    btn_save = "xpath=>/html/body/div[2]/div/div[2]/div/div[2]/div[3]/div/button[2]"
    btn_cancel = "xpath=>/html/body/div[2]/div/div[2]/div/div[2]/div[3]/div/button[1]"

    def type_nameofcustomer(self, text):
        self.type(self.input_nameofcustomer, text)

    def type_email(self, text):
        self.type(self.input_email, text)

    def type_contactperson(self, text):
        self.type(self.input_contactperson, text)

    def type_tel(self, text):
        self.type(self.input_tel, text)

    def click_save(self):
        self.click(self.btn_save)
        self.sleep(3)

    def click_cancel(self):
        self.click(self.btn_cancel)
        self.sleep(3)